const initialState = {
  records: [],
  test:'hehehe'
};

const recordModel = {
  namespace: "record",
  state: initialState,
  reducers: {
    setState(state = initialState, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
  effects: {
    *addRecords(action, { put, select }) {
      console.log("action", action);
      const { records } = yield select((state) => state.record);
      console.log(records);
      yield put({
        type: "setState",
        payload: {
          records: records.action.payload.records,
        },
      });
    },
  },
};

export default recordModel;
